// 数组类型
// 以下两种方式都可以
const arr1: Array<number> = [1, 2, 3]
const arr2: number[] = [1, 2, 3]

function sum(...args: Array<number>) {
    return args.reduce((prev, current) => {
        return prev + current
    }, 0)
}
sum(...arr1)
sum(...arr2)